<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>供应商信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
	function subForm(){
		var falg = false;
		if($("#psName").val() == '' || $("#psName").val() == null){
			top.$.jBox.tip("请输入单位名称", 'info');
			return false;
		}else if($("#contacts").val() == '' || $("#contacts").val() == null){
			top.$.jBox.tip("请输入联络人", 'info');
			return false;
		}else if($("#phone").val() == '' || $("#phone").val() == null){
			top.$.jBox.tip("请输入联系电话", 'info');
			return false;
		}else{
			$.ajax({
                cache: true,
                type: "POST",
                url:"${ctx}/zx/proSupplier/saveSupplierInfo",
                data:$('#addProSupplierForm').serialize(),// 
                async: false,
                error: function(XMLHttpRequest) {
                	top.$.jBox.tip("表单提交异常", 'info');         
                },
                success: function(data) {
                	if(data == '1'){
                		top.$.jBox.tip("供应商已存在，请勿重复添加", 'info');
                	}else{
                		top.$.jBox.tip("供应商信息保存成功", 'info');
                		falg = true;
                	}
                }
            });
			return falg;
		}
	}
	</script>
</head>
<body>
	
	<form:form id="addProSupplierForm" method="post" class="form-horizontal">
		<input type="hidden" name="lzdId" value="${lzdId}">	
		<input type="hidden" name="sectionId" value="${sectionId}">
		<sys:message content="${message}"/>		
		<div class="control-group" style="margin-top: 15px">
			<label class="control-label">单位名称：</label>
			<div class="controls">
				<input name="name" maxlength="100" class="input-xlarge zx-input" id="psName"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联络人：</label>
			<div class="controls">
				<input name="contacts" maxlength="100" class="input-xlarge zx-input" id="contacts"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<input name="phone" maxlength="100" class="input-xlarge zx-input" id="phone"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系地址：</label>
			<div class="controls">
				<input name="address" maxlength="255" class="input-xlarge zx-input" id="address"/>
				<!-- <span class="help-inline"><font color="red">*</font> </span> -->
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<textarea rows="4" class="input-xxlarge" maxlength="255" name="remarks"></textarea>
			</div>
		</div>
		
	</form:form>
</body>
</html>